package lib.ui{
	
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFieldType;
	import flash.text.TextFormat;
	
	public class InputText extends Sprite{
		
		private var _text:TextField;
		
		public function InputText(str:String="标签",flag:uint = 0){
			var label:TextField = new TextField();
			//_text.autoSize = TextFieldAutoSize.CENTER;
			label.defaultTextFormat = new TextFormat("Times New Roman",12,0xFFFFFF,true);
			label.type = TextFieldType.DYNAMIC;
			label.height = 20;
			label.width = 60;
			label.text = str;
			this.addChild(label);
			
			_text = new TextField();
			_text.defaultTextFormat = new TextFormat("Times New Roman",12,0xFFFFFF,true);
			_text.type = TextFieldType.INPUT;
			_text.x = 50;
			_text.height = 20;
			_text.width = 150;
			_text.border = true;
			if(flag)_text.displayAsPassword = true;
			this.addChild(_text);
		}
		
		public function get text():String{
			return _text.text;
		}
	}
}